/*
 * 英才汇硕信息科技有限公司 (c) 版权所有  2020-2023.
 */
package cn.edu.tyu.finance.util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * MySQL数据库实用类
 * @author wuzhijun
 * @version 1.0
 */
public class DbUtil {
	 public static void main(String[] args) {
		DbUtil dbUtil = new DbUtil();
		Connection conn = dbUtil.getConnection();
		System.out.println(conn);
	}
	 public Connection getConnection() {
		 Connection conn = null;
		 String url = "jdbc:mysql://localhost:3306/financedb";
		 try {
			conn = DriverManager.getConnection(url, "root", "ROOT");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		 return conn;
	 }

}








